package com.fhz.lifeandvm;

import androidx.annotation.NonNull;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;

/**
 * 时间:2023/8/15
 *
 * @author Mr.Feng
 * 简述: TODO
 */
public class MainViewModelFactory implements ViewModelProvider.Factory {


    private int i;
    public MainViewModelFactory(int i) {
        this.i = i;
    }

    @NonNull
    @Override
    public <T extends ViewModel> T create(@NonNull Class<T> modelClass) {
        return (T) new MainViewModel(i);
    }
}
